<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.util.collection.TreeBag</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.util.collection.TreeBag";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.util.collection.TreeBag.html" class="symbol">tango.util.collection.TreeBag</a></h1>
  
<dl>
<dt class="decl">class <a class="symbol _class" name="TreeBag" href="./htmlsrc/tango.util.collection.TreeBag.html#L32" kind="class" beg="32" end="484">TreeBag</a><span class="tparams">(T)</span> : BagCollection!(T), SortedValues!(T); <a title="Permalink to this symbol" href="#TreeBag" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L32">#</a></dt>
<dd class="ddef">
<div class="summary">RedBlack trees.</div>
<p class="sec_header">Author:</p>Doug Lea
<dl>
<dt class="decl">RBCellT <a class="symbol _variable" name="TreeBag.tree" href="./htmlsrc/tango.util.collection.TreeBag.html#L47" kind="variable" beg="47" end="47">tree</a>; <span class="attrs">[<span class="prot">package</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.tree" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L47">#</a></dt>
<dd class="ddef">
<div class="summary">The root of the tree. Null if empty.</div></dd>
<dt class="decl">ComparatorT <a class="symbol _variable" name="TreeBag.cmp_" href="./htmlsrc/tango.util.collection.TreeBag.html#L52" kind="variable" beg="52" end="52">cmp_</a>; <span class="attrs">[<span class="prot">protected</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.cmp_" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L52">#</a></dt>
<dd class="ddef">
<div class="summary">The comparator to use for ordering.</div></dd>
<dt class="decl"><a class="symbol _ctor" name="TreeBag.this" href="./htmlsrc/tango.util.collection.TreeBag.html#L60" kind="ctor" beg="60" end="63">this</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L60">#</a></dt>
<dd class="ddef">
<div class="summary">Make an empty tree.
 Initialize to use DefaultComparator for ordering</div></dd>
<dt class="decl"><a class="symbol _ctor" name="TreeBag.this:2" href="./htmlsrc/tango.util.collection.TreeBag.html#L70" kind="ctor" beg="70" end="73">this</a><span class="params">(Predicate <em>s</em>)</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.this:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L70">#</a></dt>
<dd class="ddef">
<div class="summary">Make an empty tree, using the supplied element screener.
 Initialize to use DefaultComparator for ordering</div></dd>
<dt class="decl"><a class="symbol _ctor" name="TreeBag.this:3" href="./htmlsrc/tango.util.collection.TreeBag.html#L78" kind="ctor" beg="78" end="81">this</a><span class="params">(ComparatorT <em>c</em>)</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.this:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L78">#</a></dt>
<dd class="ddef">
<div class="summary">Make an empty tree, using the supplied element comparator for ordering.</div></dd>
<dt class="decl"><a class="symbol _ctor" name="TreeBag.this:4" href="./htmlsrc/tango.util.collection.TreeBag.html#L86" kind="ctor" beg="86" end="89">this</a><span class="params">(Predicate <em>s</em>, ComparatorT <em>c</em>)</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.this:4" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L86">#</a></dt>
<dd class="ddef">
<div class="summary">Make an empty tree, using the supplied element screener and comparator</div></dd>
<dt class="decl"><a class="symbol _ctor" name="TreeBag.this:5" href="./htmlsrc/tango.util.collection.TreeBag.html#L95" kind="ctor" beg="95" end="104">this</a><span class="params">(Predicate <em>s</em>, ComparatorT <em>cmp</em>, RBCellT <em>t</em>, int <em>n</em>)</span>; <span class="attrs">[<span class="prot">protected</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.this:5" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L95">#</a></dt>
<dd class="ddef">
<div class="summary">Special version of constructor needed by clone()</div></dd>
<dt class="decl">int <a class="symbol _function" name="TreeBag.compare" href="./htmlsrc/tango.util.collection.TreeBag.html#L115" kind="function" beg="115" end="121">compare</a><span class="params">(T <em>fst</em>, T <em>snd</em>)</span>; <span class="attrs">[<span class="prot">private</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.compare" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L115">#</a></dt>
<dd class="ddef">
<div class="summary">The default comparator</div>
@param fst first argument
 @param snd second argument
<p class="sec_header">Returns:</p>a negative number if fst is less than snd; a
 positive number if fst is greater than snd; else 0</dd>
<dt class="decl">TreeBag!(T) <a class="symbol _function" name="TreeBag.duplicate" href="./htmlsrc/tango.util.collection.TreeBag.html#L128" kind="function" beg="128" end="134">duplicate</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.duplicate" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L128">#</a></dt>
<dd class="ddef">
<div class="summary">Make an independent copy of the tree. Does not clone elements.</div></dd>
<dt class="decl">bool <a class="symbol _function" name="TreeBag.contains" href="./htmlsrc/tango.util.collection.TreeBag.html#L145" kind="function" beg="145" end="151">contains</a><span class="params">(T <em>element</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.contains" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L145">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.impl.Collection.Collection.contains
 Time complexity: O(log n).</div>
<p class="sec_header">See Also:</p>tango.util.collection.impl.Collection.Collection.contains</dd>
<dt class="decl">uint <a class="symbol _function" name="TreeBag.instances" href="./htmlsrc/tango.util.collection.TreeBag.html#L158" kind="function" beg="158" end="164">instances</a><span class="params">(T <em>element</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.instances" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L158">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.impl.Collection.Collection.instances
 Time complexity: O(log n).</div>
<p class="sec_header">See Also:</p>tango.util.collection.impl.Collection.Collection.instances</dd>
<dt class="decl">GuardIterator!(T) <a class="symbol _function" name="TreeBag.elements" href="./htmlsrc/tango.util.collection.TreeBag.html#L171" kind="function" beg="171" end="174">elements</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.elements" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L171">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.impl.Collection.Collection.elements
 Time complexity: O(1).</div>
<p class="sec_header">See Also:</p>tango.util.collection.impl.Collection.Collection.elements</dd>
<dt class="decl">int <a class="symbol _function" name="TreeBag.opApply" href="./htmlsrc/tango.util.collection.TreeBag.html#L181" kind="function" beg="181" end="185">opApply</a><span class="params">(int delegate (inout T value) <em>dg</em>)</span>; <a title="Permalink to this symbol" href="#TreeBag.opApply" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L181">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.model.View.View.opApply
 Time complexity: O(n).</div>
<p class="sec_header">See Also:</p>tango.util.collection.model.View.View.opApply</dd>
<dt class="decl">ComparatorT <a class="symbol _function" name="TreeBag.comparator" href="./htmlsrc/tango.util.collection.TreeBag.html#L196" kind="function" beg="196" end="199">comparator</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.comparator" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L196">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.ElementSortedCollection.comparator
 Time complexity: O(1).</div>
<p class="sec_header">See Also:</p>tango.util.collection.ElementSortedCollection.comparator</dd>
<dt class="decl">void <a class="symbol _function" name="TreeBag.comparator:2" href="./htmlsrc/tango.util.collection.TreeBag.html#L205" kind="function" beg="205" end="227">comparator</a><span class="params">(ComparatorT <em>cmp</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.comparator:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L205">#</a></dt>
<dd class="ddef">
<div class="summary">Reset the comparator. Will cause a reorganization of the tree.
 Time complexity: O(n log n).</div></dd>
<dt class="decl">void <a class="symbol _function" name="TreeBag.clear" href="./htmlsrc/tango.util.collection.TreeBag.html#L237" kind="function" beg="237" end="241">clear</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.clear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L237">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.impl.Collection.Collection.clear.
 Time complexity: O(1).</div>
<p class="sec_header">See Also:</p>tango.util.collection.impl.Collection.Collection.clear</dd>
<dt class="decl">void <a class="symbol _function" name="TreeBag.removeAll" href="./htmlsrc/tango.util.collection.TreeBag.html#L248" kind="function" beg="248" end="251">removeAll</a><span class="params">(T <em>element</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.removeAll" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L248">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.impl.Collection.Collection.removeAll.
 Time complexity: O(log n * instances(element)).</div>
<p class="sec_header">See Also:</p>tango.util.collection.impl.Collection.Collection.removeAll</dd>
<dt class="decl">void <a class="symbol _function" name="TreeBag.remove" href="./htmlsrc/tango.util.collection.TreeBag.html#L259" kind="function" beg="259" end="262">remove</a><span class="params">(T <em>element</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.remove" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L259">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.impl.Collection.Collection.removeOneOf.
 Time complexity: O(log n).</div>
<p class="sec_header">See Also:</p>tango.util.collection.impl.Collection.Collection.removeOneOf</dd>
<dt class="decl">void <a class="symbol _function" name="TreeBag.replace" href="./htmlsrc/tango.util.collection.TreeBag.html#L269" kind="function" beg="269" end="272">replace</a><span class="params">(T <em>oldElement</em>, T <em>newElement</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.replace" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L269">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.impl.Collection.Collection.replaceOneOf
 Time complexity: O(log n).</div>
<p class="sec_header">See Also:</p>tango.util.collection.impl.Collection.Collection.replaceOneOf</dd>
<dt class="decl">void <a class="symbol _function" name="TreeBag.replaceAll" href="./htmlsrc/tango.util.collection.TreeBag.html#L279" kind="function" beg="279" end="282">replaceAll</a><span class="params">(T <em>oldElement</em>, T <em>newElement</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.replaceAll" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L279">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.impl.Collection.Collection.replaceAllOf.
 Time complexity: O(log n * instances(oldElement)).</div>
<p class="sec_header">See Also:</p>tango.util.collection.impl.Collection.Collection.replaceAllOf</dd>
<dt class="decl">T <a class="symbol _function" name="TreeBag.take" href="./htmlsrc/tango.util.collection.TreeBag.html#L290" kind="function" beg="290" end="303">take</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.take" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L290">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.impl.Collection.Collection.take.
 Time complexity: O(log n).
 Takes the least element.</div>
<p class="sec_header">See Also:</p>tango.util.collection.impl.Collection.Collection.take</dd>
<dt class="decl">void <a class="symbol _function" name="TreeBag.addIf" href="./htmlsrc/tango.util.collection.TreeBag.html#L313" kind="function" beg="313" end="316">addIf</a><span class="params">(T <em>element</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.addIf" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L313">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.MutableBag.addIfAbsent
 Time complexity: O(log n).</div>
<p class="sec_header">See Also:</p>tango.util.collection.MutableBag.addIfAbsent</dd>
<dt class="decl">void <a class="symbol _function" name="TreeBag.add" href="./htmlsrc/tango.util.collection.TreeBag.html#L324" kind="function" beg="324" end="327">add</a><span class="params">(T <em>element</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.add" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L324">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.MutableBag.add.
 Time complexity: O(log n).</div>
<p class="sec_header">See Also:</p>tango.util.collection.MutableBag.add</dd>
<dt class="decl">void <a class="symbol _function" name="TreeBag.checkImplementation" href="./htmlsrc/tango.util.collection.TreeBag.html#L419" kind="function" beg="419" end="441">checkImplementation</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">override</span>]</span> <a title="Permalink to this symbol" href="#TreeBag.checkImplementation" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L419">#</a></dt>
<dd class="ddef">
<div class="summary">Implements tango.util.collection.model.View.View.checkImplementation.</div>
<p class="sec_header">See Also:</p>tango.util.collection.model.View.View.checkImplementation</dd>
<dt class="decl">class <a class="symbol _class" name="TreeBag.CellIterator" href="./htmlsrc/tango.util.collection.TreeBag.html#L451" kind="class" beg="451" end="483">CellIterator</a><span class="tparams">(T)</span> : AbstractIterator!(T); <a title="Permalink to this symbol" href="#TreeBag.CellIterator" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.collection.TreeBag.html#L451">#</a></dt>
<dd class="ddef">
<div class="summary">opApply() has migrated here to mitigate the virtual call
                on method get()</div>
</dd></dl></dd></dl>
</div>
<div id="footer">
  <p></p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:09 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>